<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui"
	template="/pages/templates/template.xhtml">

	<ui:define name="meio">
		<ui:include src="menu.xhtml" />
	</ui:define>

	<ui:define name="centro">
		<div align="center">
			<h:form id="Form" enctype="multipart/form-data">
				<p:growl id="growl" showDetail="true" life="5000" />
				<table>
					<tr>
						<td><h:outputText value="Titulo: " /></td>
						<td><p:inputText id="titulo" label="titulo"
								value="#{fileUploadMB.titulo}" required="true"
								requiredMessage="Campo Titulo necess&#225;rio." /></td>
					</tr>
					<tr>
						<td><h:outputText value="Categoria:" /></td>

						<td><h:selectOneMenu id="categoria" label="categoria"
								class="ui-selectonemenu-label ui-inputfield ui-corner-all"
								value="#{fileUploadMB.categoria}" required="true"
								requiredMessage="Campo Categoria necess&#225;rio.">
								<f:selectItem itemLabel="Selecione uma categoria." />
								<f:selectItems value="#{pageControl.categorias}" />
							</h:selectOneMenu></td>
					</tr>
					<tr>
						<td><h:outputText value="Nivel de Acesso:" /></td>

						<td><h:selectOneMenu id="nvl" label="nvl"
								value="#{fileUploadMB.nvlAcesso}"
								class="ui-selectonemenu-label ui-inputfield ui-corner-all"
								required="true"
								requiredMessage="Campo Nivel de Acesso necess&#225;rio.">
								<f:selectItem itemLabel="Selecione um nivel de acesso."
									noSelectionOption="true" />
								<f:selectItems value="#{pageControl.nvlsAcesso}" var="n"
									itemLabel="#{n}" itemValue="#{n.id}" />
							</h:selectOneMenu></td>
					</tr>
					<tr>
						<td valign="top"><h:outputText value="Resumo:" /></td>
						<td><p:inputTextarea id="resumo" label="resumo" cols="50"
								rows="10" value="#{fileUploadMB.resumo}" required="true"
								requiredMessage="Campo Resumo necess&#225;rio." /></td>
					</tr>
					<tr>
						<td><h:outputText value="Arquivo: " /></td>
						<td><p:fileUpload label="" dragDropSupport="false"
								mode="simple" required="true"
								requiredMessage="Campo Arquivo necess&#225;rio."
								value="#{fileUploadMB.file}"></p:fileUpload></td>
					</tr>
					<tr>
						<td colspan="2"><p:commandButton
								action="#{fileUploadMB.upload}" value="Confirmar" update="growl" ajax="false" /></td>
					</tr>
				</table>
			</h:form>
		</div>
	</ui:define>

</ui:composition>